package com.movil.registrodelapropiedadgt;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

public class Prueba_listView extends Activity {
	List<String[]> listaVitacora= new LinkedList<String[]>();
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_prueba_list_view);
		
		listaVitacora.add(new String[]{"RECIBO RGP","14/11/2013 15:30:37 NLC291"});
		listaVitacora.add(new String[]{"Reparto Automatico","14/11/2013 15:30:37 SCANGT07"});
		listaVitacora.add(new String[]{"Fondo de Tierras","14/11/2013 15:30:37 VERSEC15"});
		
		
		ListView listaView = (ListView)this.findViewById(R.id.listView_item2);
		ArrayAdapter<String[]> ArAdapter =new ArrayAdapter<String[]>(this, android.R.layout.simple_list_item_2,android.R.id.text1,listaVitacora){
			@Override
			public View getView(int position,View convertView,ViewGroup parent){
				View view= super.getView(position, convertView, parent);
				String[] entry= listaVitacora.get(position);
				TextView text1 = (TextView)view.findViewById(android.R.id.text1);
				TextView text2 = (TextView)view.findViewById(android.R.id.text2);				
			
				text1.setText(entry[0]);
				text2.setText(entry[1]);
				return view;
				
			}
		};
		
		listaView.setAdapter(ArAdapter);
		
    
		
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.prueba_list_view, menu);
		return true;
	}
	
	

}
